package com.ztgf.pay.models.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.ztgf.common.constant.Result;
import com.ztgf.pay.models.bo.PayUserBankcardSaveBO;
import com.ztgf.pay.models.bo.PayUserSaveBO;
import com.ztgf.pay.models.bo.PayZjBalanceBO;
import com.ztgf.pay.models.bo.PayZjBalanceLogBO;
import com.ztgf.pay.models.dto.PayFundDetailsDTO;
import com.ztgf.pay.models.dto.PayUserDTO;
import com.ztgf.pay.models.vo.PayBalanceExpotPcVO;
import com.ztgf.pay.models.vo.PayBalanceExpotVO;
import com.ztgf.pay.models.vo.PayUserBalanceVO;
import com.ztgf.pay.models.vo.PayZjBalanceLogVO;

import java.math.BigDecimal;
import java.util.List;

/**
 * 用户信息表服务
 *
 * @author mxli
 * @Date 2020-07-30 12:13:56
 */
public interface IPayUserService extends IService<PayUserDTO> {

    /**
     * 开户
     * @param saveBO
     * @return
     */
    Result<PayUserDTO> add(PayUserSaveBO saveBO);

    /**
     * 修改账户信息
     * @param saveBO
     * @return
     */
    Result edit(PayUserSaveBO saveBO);

    /**
     * 销户
     * @param userId
     * @param accountType 账户类型( 1:客户资金账户 3:合作方收益账户 4:手续费账户)
     * @return
     */
    Result del(Long userId, Integer accountType);


    /**
     * 获取用户余额
     * @param userId
     * @param accountType 账户类型( 1:客户资金账户 3:合作方收益账户 4:手续费账户)
     * @return
     */
    Result<PayUserBalanceVO> getUserBalance(Long userId, Integer accountType);

    /**
     * 获取中金当前交易流水
     * @param bo
     * @return
     */
    Result<Page<PayZjBalanceLogVO>> queryPageZjBalanceLog(PayZjBalanceLogBO bo);


    /**
     * 获取中金当前交易流水用于定时入库
     * @param bo
     * @return
     */
    List<PayZjBalanceLogVO> queryPageZjBalance(PayZjBalanceLogBO bo);

    /**
     * 获取中金历史交易流水
     * @param bo
     * @return
     */
    Result<Page<PayZjBalanceLogVO>> queryPageZjHistoryBalanceLog(PayZjBalanceLogBO bo);


    Result<Page<PayZjBalanceLogVO>> queryPageZjHistoryBalanceLogAdmin(PayZjBalanceLogBO bo);

    Result<Page<PayFundDetailsDTO>> queryPageZjHistoryBalanceLog1(PayZjBalanceLogBO bo);


    /**
     * 绑卡
     * @param bo
     * @return
     */
    Result addBankCard(PayUserBankcardSaveBO bo);

    /**
     * 修改绑卡
     * @param bo
     * @return
     */
    Result editBankCard(PayUserBankcardSaveBO bo);

    /**
     * 解绑
     * @param userId
     * @param bankCard
     * @param accountType 账户类型( 1:客户资金账户 3:合作方收益账户 4:手续费账户)
     * @return
     */
    Result delBankCard(Long userId, Integer accountType,  String bankCard);

    /**
     * 激活卡片
     * @param id
     * @param userId
     * @param accountType 账户类型( 1:客户资金账户 3:合作方收益账户 4:手续费账户)
     * @param money
     * @return
     */
    Result saveActivationBankCard(Long userId, Integer accountType, Long id, BigDecimal money);

    PayUserDTO getPayUserDTO(Long userId, Integer accountType);

    PayUserDTO getPayUserDTO(Long userId);

    /**
     * 根据中金资金账号查找
     * @param zjMoneyNo 中金资金账号
     * @return
     */
    PayUserDTO getPayUserDTO(String zjMoneyNo);

    Result updateNoWithdrawMoney(PayUserDTO dto);
    Result saveNoWithdrawMoney(Long userId, Integer accountType,  BigDecimal money);

    void fundDetailByHistory();
   /**

    * @author  eric
    * @Param
    * @Return
    * @create  2021/11/30 16:31
    * @desc admin查询历史中金列表

    **/
    Result<Page<PayFundDetailsDTO>> queryPageZjHistoryBalanceLogList(PayZjBalanceBO bo);

//    Result<Page<PayZjBalanceLogVO>> queryPageZjBalanceLogList(PayZjBalanceBO bo);
    /**

     * @author  eric
     * @Param
     * @Return
     * @create  2021/11/30 16:31
     * @desc admin島出历史中金列表

     **/
    List<PayBalanceExpotVO> batchExportBalanceList(PayZjBalanceBO bo);
    /**

     * @author  eric
     * @Param
     * @Return
     * @create  2021/11/30 16:31
     * @desc pc島出历史中金列表

     **/
    List<PayBalanceExpotPcVO> batchExportBalanceListByPc(PayZjBalanceBO bo);
}
